package net.oschina.archx.spring;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * Application
 *
 * @author Archx
 * @date 2015/6/23 0023
 */
public class Application {
    public static void main(String[] args) {
        String str="13112341234,010-12456789,01012456789,(010)12456789,00861012456789,+861012456789";
        Pattern p= Pattern.compile("1([\\d]{10})|((\\+[0-9]{2,4})?\\(?[0-9]+\\)?-?)?[0-9]{7,8}");
        Matcher m;
        for (String s: str.split(",")) {
            m = p.matcher(s);
            System.out.println(m.matches());
        }
        System.out.println(">>>>>>>>>>>>>>>>>>>>>>>>>>>>");
        m=p.matcher(str);

        System.out.println(m.matches());
        while(m.find()){
            System.out.println(m.group());
        }
    }
}
